package com.sharker.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.List;

/**
 * 项目名称：Sharker-master
 * 类描述：
 * 创建人：${丁江楠}
 * 创建时间：2017/4/13 11:16
 * 修改人：${丁江楠}
 * 修改时间：2017/4/13 11:16
 * 修改备注：
 */
public class TablayoutViewpagerAdapter extends FragmentStatePagerAdapter {
    private Context context;
    private List<Fragment> flist;
    private List<String> list;

    public TablayoutViewpagerAdapter(FragmentManager fm, Context context, List<Fragment> flist, List<String> list) {
        super(fm);
        this.context = context;
        this.flist = flist;
        this.list = list;
    }

    @Override
    public Fragment getItem(int position) {
        return flist.get(position);
    }

    @Override
    public int getCount() {
        return flist.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return list.get(position);
    }
}
